home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / misc / emu / ATUtilities.lha / ATUtilities / ft.c < prev    next >
C/C++ Source or Header  |  2000-09-26  |  17KB  |  671 lines

  1. /* ******************************************************************* */
  2. /* **                                                               ** */
  3. /* **                     ATKeyboard Version 4.0                    ** */
  4. /* **           Copright (C) 1992-1994 by Thomas Dreibholz          ** */
  5. /* **                       All rights reserved                     ** */
  6. /* **                                                               ** */
  7. /* **                       F-Tasten-Verwaltung                     ** */
  8. /* **                                                               ** */
  9. /* ******************************************************************* */
  10.  
  11. #include "ATKeyboard.h"
  12.  
  13. EXTERN UBYTE                *HelpName;
  14. EXTERN LONG                  KickstartVersion;
  15. extern struct Einstellungen  Einstellungen;
  16. extern struct KeyCodes      *KeyCodes;
  17. extern struct FileRequester *FileRequester;
  18. extern struct IntuiText      Trennlinie_Text;
  19. extern struct IntuiText      Wirklich_Text;
  20. extern struct TextAttr       OpalFontDef;
  21.  
  22. struct IntuiText FK_Text=
  23. {
  24.  AUTOFRONTPEN,AUTOBACKPEN,AUTODRAWMODE,AUTOLEFTEDGE,1,&OpalFontDef,
  25.  "Kommentar ändern",
  26. };
  27.  
  28. struct IntuiText FU_Text=
  29. {
  30.  AUTOFRONTPEN,AUTOBACKPEN,AUTODRAWMODE,AUTOLEFTEDGE,1,&OpalFontDef,
  31.  "Rücknahme aller Aktionen",
  32. };
  33.  
  34. struct IntuiText FL_Text=
  35. {
  36.  AUTOFRONTPEN,AUTOBACKPEN,AUTODRAWMODE,AUTOLEFTEDGE,1,&OpalFontDef,
  37.  "FKey-Datei laden",
  38. };
  39.  
  40. struct IntuiText FS_Text=
  41. {
  42.  AUTOFRONTPEN,AUTOBACKPEN,AUTODRAWMODE,AUTOLEFTEDGE,1,&OpalFontDef,
  43.  "FKey-Datei sichern",
  44. };
  45.  
  46. struct IntuiText FE_Text=
  47. {
  48.  AUTOFRONTPEN,AUTOBACKPEN,AUTODRAWMODE,AUTOLEFTEDGE,1,&OpalFontDef,
  49.  "Übernehmen und Beenden",
  50. };
  51.  
  52.  
  53. struct MenuItem FE_Item=
  54. {
  55.  NULL,
  56.  5,30,300,10,
  57.  HIGHIMAGE|ITEMENABLED|ITEMTEXT|COMMSEQ,
  58.  0L,
  59.  &FE_Text,
  60.  &Wirklich_Text,
  61.  'Q',NULL
  62. };
  63.  
  64. struct MenuItem Trennlinie01_Item=
  65. {
  66.  &FE_Item,
  67.  5,20,300,10,
  68.  HIGHNONE|ITEMTEXT,
  69.  0L,
  70.  &Trennlinie_Text,
  71.  NULL,
  72.  0,NULL
  73. };
  74.  
  75. struct MenuItem FS_Item=
  76. {
  77.  &Trennlinie01_Item,
  78.  5,10,300,10,
  79.  HIGHCOMP|ITEMENABLED|ITEMTEXT|COMMSEQ,
  80.  0L,
  81.  &FS_Text,
  82.  NULL,
  83.  'S',NULL
  84. };
  85.  
  86. struct MenuItem FL_Item=
  87. {
  88.  &FS_Item,
  89.  5,0,300,10,
  90.  HIGHCOMP|ITEMENABLED|ITEMTEXT|COMMSEQ,
  91.  0L,
  92.  &FL_Text,
  93.  NULL,
  94.  'L',NULL
  95. };
  96.  
  97. struct MenuItem FK_Item=
  98. {
  99.  NULL,
  100.  5,10,300,10,
  101.  HIGHCOMP|ITEMENABLED|ITEMTEXT|COMMSEQ,
  102.  0L,
  103.  &FK_Text,
  104.  NULL,
  105.  'K',NULL
  106. };
  107.  
  108. struct MenuItem FU_Item=
  109. {
  110.  &FK_Item,
  111.  5,0,300,10,
  112.  HIGHCOMP|ITEMENABLED|ITEMTEXT|COMMSEQ,
  113.  0L,
  114.  &FU_Text,
  115.  NULL,
  116.  'X',NULL
  117. };
  118.  
  119. struct Menu Bearbeiten_Menu=
  120. {
  121.  NULL,
  122.  140,0,130,10,
  123.  MENUENABLED,
  124.  "Bearbeiten",
  125.  &FU_Item
  126. };
  127.  
  128. struct Menu Datei_Menu=
  129. {
  130.  &Bearbeiten_Menu,
  131.  5,0,130,10,
  132.  MENUENABLED,
  133.  "Datei",
  134.  &FL_Item
  135. };
  136.  
  137. #define MENU_DATEI 0
  138. #define ITEM_LADEN 0
  139. #define ITEM_SICHERN 1
  140. #define ITEM_ENDE 3
  141. #define MENU_BEARBEITEN 1
  142. #define ITEM_UNDO 0
  143. #define ITEM_KOMMENTAR 1
  144.  
  145. UBYTE Kommentar[25];
  146. UBYTE Undo[25];
  147.  
  148. struct StringInfo SInfo=
  149. {
  150.  &Kommentar,
  151.  &Undo,
  152.  1,24
  153. };
  154.  
  155. struct Gadget Kommentar_Gadget=
  156. {
  157.  NULL,
  158.  229,44,200,10,
  159.  GADGHCOMP,
  160.  TOGGLESELECT|RELVERIFY,
  161.  STRGADGET,
  162.  NULL,NULL,NULL,
  163.  NULL,&SInfo,200,NULL
  164. };
  165.  
  166. struct Gadget Aufnahme_Gadget=
  167. {
  168.  NULL,
  169.  10,40,91,13,
  170.  GADGHCOMP,
  171.  TOGGLESELECT|GADGIMMEDIATE,
  172.  BOOLGADGET,
  173.  NULL,NULL,NULL,
  174.  NULL,NULL,102,NULL
  175. };
  176.  
  177. struct Gadget *Shift_Gadget;
  178. struct Gadget *Ctrl_Gadget;
  179.  
  180. UBYTE Nummer;
  181. UBYTE Shift,Ctrl;
  182.  
  183.  
  184. /* Codeposition ermitteln */
  185. UBYTE *GetCode()
  186. {
  187.  REGISTER UBYTE *code;
  188.  
  189.  code=&KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten.FTasten[Nummer-1];
  190.  if((Shift!=0)&&(Ctrl==0)) code=&KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten.FTastenShift[Nummer-1];
  191.  if((Shift==0)&&(Ctrl!=0)) code=&KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten.FTastenCtrl[Nummer-1];
  192.  if((Shift!=0)&&(Ctrl!=0)) code=&KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten.FTastenShiftCtrl[Nummer-1];
  193.  return(code);
  194. }
  195.  
  196.  
  197. /* Kommentarposition ermitteln */
  198. UBYTE *GetK()
  199. {
  200.  REGISTER UBYTE *k;
  201.  
  202.  k=&KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten.FTastenKommentar[Nummer-1];
  203.  if((Shift!=0)&&(Ctrl==0)) k=&KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten.FTastenShiftKommentar[Nummer-1];
  204.  if((Shift==0)&&(Ctrl!=0)) k=&KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten.FTastenCtrlKommentar[Nummer-1];
  205.  if((Shift!=0)&&(Ctrl!=0)) k=&KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten.FTastenShiftCtrlKommentar[Nummer-1];
  206.  return(k);
  207. }
  208.  
  209.  
  210. /* F-Tastenbelegungen zeigen */
  211. VOID ZeigeFTasten()
  212. {
  213.  UBYTE                         text[40];
  214.  UBYTE                        *code;
  215.  UBYTE                        *k;
  216.  REGISTER BOOL                 ende;
  217.  REGISTER ULONG                Class;
  218.  REGISTER WORD                 i,Code;
  219.  struct Gadget                *ZeigeShift_Gadget,*ZeigeCtrl_Gadget;
  220.  register struct Gadget       *gad;
  221.  register struct Window       *win;
  222.  register struct RastPort     *rp;
  223.  register struct IntuiMessage *msg;
  224.  
  225.  Shift=Ctrl=0;
  226.  win=CreateStdWindow("ATKeyboard - Funktionstastenbelegung zeigen",
  227.                      75,75,450,160,
  228.                      GADGETUP|GADGETDOWN|CLOSEWINDOW|VANILLAKEY,
  229.                      WINDOWDEPTH|WINDOWDRAG|WINDOWCLOSE|ACTIVATE);
  230.  if(win!=NULL)
  231.   {
  232.    rp=win->RPort;
  233.    SetFont(rp,GetOpalFont());
  234.    ZeigeShift_Gadget=CreateNToggleGadget(win,10,12,120,12,"Shift",100);
  235.    ZeigeCtrl_Gadget=CreateNToggleGadget(win,135,12,120,12,"Control",101);
  236.    CreateBoolGadget(win,320,12,120,12,"Hilfe",102);
  237.    DrawNBorder(win,12,28,428,129);
  238.    ende=FALSE;
  239.    while(ende==FALSE)
  240.     {
  241.      for(Nummer=1;Nummer<=10;Nummer++)
  242.       {
  243.        i=Nummer*12;
  244.        SetAPen(rp,0);
  245.        RectFill(rp,19,20+i,439,30+i);
  246.        SelectStdFPen(rp);
  247.        sprintf(&text,"F%ld:",Nummer);
  248.        WriteText(rp,20,28+i,&text);
  249.        code=GetCode();
  250.        k=GetK();
  251.        if(code[0]==0)
  252.         {
  253.          strcpy(&text,"(Tastenkombination ist nicht belegt)");
  254.         }
  255.        else if((code[0]!=0)&&(k[0]==0))
  256.         {
  257.          strcpy(&text,"(Belegt, aber keine Benennung - Benutzen Sie \"Kommentar ändern\")");
  258.         }
  259.        else
  260.         {
  261.          strcpy(&text,k);
  262.         }
  263.        WriteText(rp,70,28+(Nummer*12),&text);
  264.       }
  265.      WaitPort(win->UserPort);
  266.      msg=GetMsg(win->UserPort);
  267.      Class=msg->Class;
  268.      Code=msg->Code;
  269.      gad=msg->IAddress;
  270.      ReplyMsg(msg);
  271.      switch(Class)
  272.       {
  273.        case CLOSEWINDOW:
  274.          ende=TRUE;
  275.         break;
  276.        case GADGETUP:
  277.        case GADGETDOWN:
  278.          switch(gad->GadgetID)
  279.           {
  280.            case 100:
  281.              if(ZeigeShift_Gadget->Flags & SELECTED) Shift=1; else Shift=0;
  282.             break;
  283.            case 101:
  284.              if(ZeigeCtrl_Gadget->Flags & SELECTED) Ctrl=1; else Ctrl=0;
  285.             break;
  286.            case 102:
  287.              if(Class==GADGETUP) Help(HelpName,149);
  288.             break;
  289.           }
  290.         break;
  291.        case VANILLAKEY:
  292.          if(Code==13) ende=TRUE;
  293.         break;
  294.       }
  295.     }
  296.    DeleteStdWindow(win);
  297.   }
  298. }
  299.  
  300.  
  301. /* Tastencodes zeigen */
  302. VOID ZeigeCode(rp,bool)
  303.  struct RastPort *rp;
  304. {
  305.  REGISTER WORD  x,y,n,anz;
  306.  UBYTE         *code;
  307.  UBYTE          tx[6];
  308.  
  309.  if(bool==TRUE)
  310.   {
  311.    SetAPen(rp,0);
  312.    RectFill(rp,11,56,468,108);
  313.   }
  314.  SelectStdFPen(rp);
  315.  code=GetCode();
  316.  n=1; anz=code[0];
  317.  for(y=1;y<=4;y++)
  318.   {
  319.    strcpy(&text,"");
  320.    for(x=1;x<=12;x++)
  321.     {
  322.      if(n<=anz)
  323.       {
  324.        sprintf(&tx,"$%02lx ",code[n]);
  325.        WriteText(rp,30+(x*30),60+(y*12),&tx);
  326.       }
  327.      else
  328.       {
  329.        WriteText(rp,30+(x*30),60+(y*12)," · ");
  330.       }
  331.      n++;
  332.     }
  333.   }
  334. }
  335.  
  336.  
  337. VOID PrintK(rp)
  338.  struct RastPort *rp;
  339. {
  340.  UBYTE *k;
  341.  
  342.  k=GetK();
  343.  SetAPen(rp,0);
  344.  RectFill(rp,225,40,425,52);
  345.  SelectStdFPen(rp);
  346.  if(k[0]!=0)
  347.   {
  348.    WriteText(rp,227,50,k);
  349.   }
  350. }
  351.  
  352.  
  353. /* Neue Belegung */
  354. VOID Aufnahme(win)
  355.  struct Window *win;
  356. {
  357.  UBYTE                        *code;
  358.  UBYTE                        *k;
  359.  REGISTER ULONG                Class;
  360.  REGISTER UWORD                Code;
  361.  REGISTER BOOL                 ende,ignore;
  362.  register struct IntuiMessage *msg;
  363.  register struct RastPort     *rp;
  364.  register struct Gadget       *gad;
  365.  REGISTER UBYTE                n;
  366.  
  367.  rp=win->RPort;
  368.  code=GetCode();
  369.  k=GetK();
  370.  strcpy(&Kommentar,k);
  371.  SetAPen(rp,0);
  372.  RectFill(rp,225,40,425,52);
  373.  AddGadget(win,&Kommentar_Gadget,-1L);
  374.  RefreshGadgets(&Kommentar_Gadget,win,NULL);
  375.  DrawNBorder(win,225,42,200,10);
  376.  for(n=0;n<49;n++) code[n]=0x00;
  377.  ZeigeCode(rp,TRUE);
  378.  ende=FALSE;
  379.  ignore=FALSE;
  380.  n=1;
  381.  while(ende==FALSE)
  382.   {
  383.    WaitPort(win->UserPort);
  384.    msg=GetMsg(win->UserPort);
  385.    Class=msg->Class;
  386.    Code=msg->Code;
  387.    gad=msg->IAddress;
  388.    ReplyMsg(msg);
  389.    switch(Class)
  390.     {
  391.      case RAWKEY:
  392.        if(n<=48)
  393.         {
  394.          if(!((ignore==TRUE)&&(Code==0xc4)))
  395.           {
  396.            code[n]=(UBYTE)Code;
  397.            code[0]=n;
  398.            n++;
  399.            ZeigeCode(rp,FALSE);
  400.            ignore=FALSE;
  401.           }
  402.         }
  403.        else
  404.         {
  405.          DisplayBeep(NULL);
  406.         }
  407.       break;
  408.      case GADGETUP:
  409.        if(gad->GadgetID==200) ignore=TRUE;
  410.      case GADGETDOWN:
  411.        if(gad->GadgetID==102) ende=TRUE;
  412.       break;
  413.     }
  414.   }
  415.  strcpy(k,&Kommentar);
  416.  RemoveGadget(win,&Kommentar_Gadget);
  417.  PrintK(rp);
  418. }
  419.  
  420.  
  421. /* F-Tasten neu belegen */
  422. VOID FTastenAendern()
  423. {
  424.  REGISTER WORD                 i,w;
  425.  REGISTER ULONG                Class;
  426.  REGISTER UWORD                Code,id,MenuNum,ItemNum;
  427.  register struct Window       *win;
  428.  register struct RastPort     *rp;
  429.  register struct IntuiMessage *msg;
  430.  struct Gadget                *IAddress;
  431.  BOOL                          ende,quit,changed;
  432.  UBYTE                         tx[30];
  433.  UBYTE                         fk[6];
  434.  UBYTE                        *k;
  435.  struct FTasten               *FUndo;
  436.  struct FileHandler           *fh;
  437.  
  438.  ende=changed=FALSE;
  439.  Nummer=1;
  440.  Ctrl=0;
  441.  Shift=0;
  442.  FUndo=AllocMem(sizeof(struct FTasten),MEMF_CLEAR|MEMF_PUBLIC);
  443.  if(FUndo==NULL) return;
  444.  strcpy(&fk,"<F1>");
  445.  CopyMem(&KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten,
  446.          FUndo,sizeof(struct FTasten));
  447.  Aufnahme_Gadget.Flags=GADGHCOMP;
  448.  
  449.  win=CreateWindow("ATKeyboard - Funktionstasten belegen",
  450.                   75,35,450,115,
  451.                   GADGETDOWN|GADGETUP|CLOSEWINDOW|RAWKEY|MENUPICK,
  452.                   WINDOWDEPTH|WINDOWDRAG|WINDOWCLOSE|ACTIVATE);
  453.  if(win!=NULL)
  454.   {
  455.    rp=win->RPort;
  456.    SetFont(rp,GetOpalFont());
  457.    SetMenuStrip(win,&Datei_Menu);
  458.    AddGadget(win,&Aufnahme_Gadget,-1L);
  459.    OnGadget(&Aufnahme_Gadget,win,NULL);
  460.    Shift_Gadget=CreateMinGadget(win,10,12,90,12,100);
  461.    Ctrl_Gadget=CreateMinGadget(win,10,26,90,12,101);
  462.    DrawPTextBorder(win,10,12,90,12,"Shift");
  463.    DrawPTextBorder(win,10,26,90,12,"Control");
  464.    DrawPTextBorder(win,10,40,90,12,"Aufnahme");
  465.    for(i=0;i<10;i++)
  466.     {
  467.      w=110+(i*33);
  468.      sprintf(&tx,"F%ld",i+1);
  469.      CreateBoolGadget(win,w,12,31,12,&tx,i+1);
  470.     }
  471.    DrawNBorder(win,10,55,415,55);
  472.    PrintK(rp);
  473.    WriteText(rp,150,34,"Taste: <F1>");
  474.    WriteText(rp,125,50,"Kommentar:");
  475.    ZeigeCode(rp,TRUE);
  476.    while(ende==FALSE)
  477.     {
  478.      WaitPort(win->UserPort);
  479.      msg=GetMsg(win->UserPort);
  480.      Class=msg->Class;
  481.      Code=msg->Code;
  482.      IAddress=msg->IAddress;
  483.      ReplyMsg(msg);
  484.      switch(Class)
  485.       {
  486.        case CLOSEWINDOW:
  487.          if(changed==TRUE)
  488.           {
  489.            ende=UsePrefs();
  490.            if(ende==FALSE)
  491.             {
  492.              CopyMem(FUndo,
  493.                      &KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten,
  494.                      sizeof(struct FTasten));
  495.             }
  496.           }
  497.          ende=TRUE;
  498.         break;
  499.        case MENUPICK:
  500.           MenuNum=MENUNUM(Code);
  501.           ItemNum=ITEMNUM(Code);
  502.           switch(MenuNum)
  503.            {
  504.             case MENU_DATEI:
  505.               switch(ItemNum)
  506.                {
  507.                 case ITEM_LADEN:
  508.                   if(FileRequester!=NULL)
  509.                    {
  510.                     k=FileReq("FKey-Datei laden:","#?.fkey");
  511.                    }
  512.                   else
  513.                    {
  514.                     k=StringAbfrage(FALSE,"FKey-Datei laden:","");
  515.                    }
  516.                   if((strcmp(k,"")))
  517.                    {
  518.                     fh=Open(k,MODE_OLDFILE);
  519.                     if(fh!=NULL)
  520.                      {
  521.                       i=Read(fh,
  522.                              &KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten,
  523.                              sizeof(struct FTasten));
  524.                       if(i!=sizeof(struct FTasten))
  525.                        {
  526.                         Requester("FKey-Datei hat falsche","Länge/Falsches Format.","Okay",NULL);
  527.                         CopyMem(FUndo,
  528.                                 &KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten,
  529.                                 sizeof(struct FTasten));
  530.                        }
  531.                       else changed=TRUE;
  532.                       Close(fh);
  533.                      }
  534.                     else
  535.                      {
  536.                       Requester("Die FKey-Datei konnte","nicht geöffnet werden.","Okay",NULL);
  537.                      }
  538.                     PrintK(rp);
  539.                     ZeigeCode(rp,TRUE);
  540.                    }
  541.                  break;
  542.                 case ITEM_SICHERN:
  543.                   if(FileRequester!=NULL)
  544.                    {
  545.                     k=FileReq("FKey-Datei sichern:","#?.fkey");
  546.                    }
  547.                   else
  548.                    {
  549.                     k=StringAbfrage(FALSE,"FKey-Datei sichern als:","");
  550.                    }
  551.                   if((strcmp(k,"")))
  552.                    {
  553.                     fh=Open(k,MODE_NEWFILE);
  554.                     if(fh!=NULL)
  555.                      {
  556.                       Write(fh,
  557.                             &KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten,
  558.                             sizeof(struct FTasten));
  559.                       Close(fh);
  560.                      }
  561.                     else
  562.                      {
  563.                       Requester("Die FKey-Datei konnte","nicht erstellt werden.","Okay",NULL);
  564.                      }
  565.                    }
  566.                  break;
  567.                 case ITEM_ENDE:
  568.                   ende=TRUE;
  569.                  break;
  570.                }
  571.              break;
  572.             case MENU_BEARBEITEN:
  573.               switch(ItemNum)
  574.                {
  575.                 case ITEM_UNDO:
  576.                   CopyMem(FUndo,
  577.                           &KeyCodes->KeyTab[Einstellungen.Tastaturmodus].FTasten,
  578.                           sizeof(struct FTasten));
  579.                   PrintK(rp);
  580.                   ZeigeCode(rp,TRUE);
  581.                  break;
  582.                 case ITEM_KOMMENTAR:
  583.                   k=GetK();
  584.                   strcpy(&Kommentar,k);
  585.                   SetAPen(rp,0);
  586.                   RectFill(rp,225,40,425,52);
  587.                   AddGadget(win,&Kommentar_Gadget,-1L);
  588.                   RefreshGadgets(&Kommentar_Gadget,win,NULL);
  589.                   ActivateGadget(&Kommentar_Gadget,win,NULL);
  590.                   DrawNBorder(win,225,42,200,10);
  591.                   quit=FALSE; changed=TRUE;
  592.                   while(quit==FALSE)
  593.                    {
  594.                     WaitPort(win->UserPort);
  595.                     msg=GetMsg(win->UserPort);
  596.                     if(msg->Class==GADGETUP) quit=TRUE;
  597.                     ReplyMsg(msg);
  598.                    }
  599.                   strcpy(k,&Kommentar);
  600.                   RemoveGadget(win,&Kommentar_Gadget);
  601.                   PrintK(rp);
  602.                  break;
  603.                }
  604.              break;
  605.            }
  606.          break;
  607.        case GADGETDOWN:
  608.          id=IAddress->GadgetID;
  609.          if(id==102)
  610.           {
  611.            changed=TRUE;
  612.            Aufnahme(win);
  613.           }
  614.          break;
  615.        case GADGETUP:
  616.          id=IAddress->GadgetID;
  617.          strcpy(&tx,"Taste: ");
  618.  
  619.          if((id>=0)&&(id<=10))
  620.           {
  621.            Nummer=id;
  622.            sprintf(&fk,"<F%ld>",Nummer);
  623.           }
  624.          else if(id==100)
  625.           {
  626.            if(Shift==0)
  627.             {
  628.              Shift=1;
  629.              DrawNBorder(win,10,12,90,12);
  630.             }
  631.            else
  632.             {
  633.              Shift=0;
  634.              DrawPBorder(win,10,12,90,12);
  635.             }
  636.           }
  637.          else if(id==101)
  638.           {
  639.            if(Ctrl==0)
  640.             {
  641.              Ctrl=1;
  642.              DrawNBorder(win,10,26,90,12);
  643.              }
  644.            else
  645.             {
  646.              Ctrl=0;
  647.              DrawPBorder(win,10,26,90,12);
  648.             }
  649.           }
  650.  
  651.          if(Shift==1) strcat(&tx,"<Shift>+");
  652.          if(Ctrl==1) strcat(&tx,"<Control>+");
  653.          strcat(&tx,&fk);
  654.          PrintK(rp);
  655.  
  656.          SetAPen(rp,0);
  657.          RectFill(rp,149,27,440,37);
  658.          SelectStdFPen(rp);
  659.          WriteText(rp,150,34,&tx);
  660.  
  661.          ZeigeCode(rp,TRUE);
  662.         break;
  663.       }
  664.     }
  665.    ClearMenuStrip(win);
  666.    DeleteStdWindow(win);
  667.   }
  668.  FreeMem(FUndo,sizeof(struct FTasten));
  669. }
  670.  
  671.